home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr01 / halcn305.zip / TUTOR14.PAS < prev    next >
Pascal/Delphi Source File  |  1993-05-03  |  1KB  |  40 lines

  1. Program Tutor14;
  2. uses
  3.    CRT,
  4.    GSOB_DBF,
  5.    GSOB_DBS,
  6.    GSOB_VAR;
  7. var
  8.    MyFile  : GSO_dBHandler;
  9.    MFields : integer;
  10.    s       : string;
  11. begin
  12.    ClrScr;
  13.    MyFile.Init('TUTOR1');
  14.    MyFile.Open;
  15.    MyFile.Index('TUTOR1LN');
  16.    MyFile.GetRec(Top_Record);     {Get the first record in the file}
  17.    while not MyFile.File_EOF do   {Repeat until end-of-file}
  18.    begin
  19.       writeln(MyFile.FieldGet('LASTNAME'));
  20.       MyFile.GetRec(Next_Record); {Get the next sequential record}
  21.    end;
  22.    writeln;
  23.    write('Enter name to find: ');
  24.    readln(s);
  25.    if MyFile.Find(s) then
  26.    begin
  27.       Writeln('Record Number ',MyFile.RecNumber,' of ',MyFile.NumRecs);
  28.       Writeln;
  29.       for MFields := 1 to MyFile.NumFields do
  30.          writeln(MFields:3,'   ',
  31.                  MyFile.FieldName(MFields):10,': ',
  32.                  MyFile.FieldGetN(MFields));
  33.       writeln;
  34.       writeln('Deleted Status = ',MyFile.DelFlag);
  35.    end
  36.    else
  37.       writeln('No Match');
  38.    MyFile.Close;
  39. end.
  40.